Coffee School Game Lesson One - Creating The Player

Code Editor

// nothing to see here, press 'Next Lesson'!

Preview

Console Log:

Game Lesson One - Creating The Player

Time estimate for this lesson: 20 minutes

If we wish to create a flappy bird style game then we need a representation of the player that we have clear the obstacles. For now, let us keep the graphics simple and focus on the key points of the game. To this end we will be representing our player with a red square.

To create our game, we’re going to be using a Javascript game framework called Crafty. The main components in Crafty are entities. Entities can represent the player’s avatar, game obstacles, environments, characters and effects among other things.

To create our player we’re going to use an entity.